//服务器全部接口返回的数据类型
export interface ResponseData {
    code: number,
    message: string,
    ok: boolean
}
//SPU数据ts类型
export interface SpuData {
    id?: number | string, //SPU对象的ID
    spuName: string, //SPU对象的名字
    description: string, //SPU描述
    category3Id: number | string,
    tmId: number | string, //品牌ID
    spuSaleAttrList: null | SaleDate[], //销售属性
    spuImageList: null | SpuImg[] //SPU图片列表
}
//数组：元素都是已有SPU数据类型
export type Records = SpuData[];
//定义获取已有的SPU接口返回的数据ts类型
export interface HasSpuResponseData extends ResponseData {
    data: {
        records: Records,
        total: number,
        size: number,
        current: number,
        searchCount: boolean,
        pages: number
    }
}
//所有品牌数据ts类型
export interface Tradmark {
    id: number,
    tmName: string,
    logoUrl: string,
}
//品牌接口返回的数据ts类型
export interface AllTradMark extends ResponseData {
    data: Tradmark[]
}
//商品图片ts类型
export interface SpuImg {
    id?: number,
    spuId?: number,
    imgName?: string,
    imgUrl?: string,
    createTime?: string,
    updateTime?: string,
    name?: string,
    url?: string
}
//已有的SPU照片强返回数据
export interface SpuHasImg extends ResponseData {
    data: SpuImg[]
}

//SPU销售属性
//已有销售属性值的对象ts类型
export interface SaleAttrValue {
    id?: number,
    createTime?: null,
    updateTime?: null,
    spuId?: number,
    baseSaleAttrId: number | string,
    saleAttrValueName: number | string,
    saleAttrName?: string,
    isChecked?: null
}
export type SpuSaleAttrValueList = SaleAttrValue[]
//销售属性ts类型
export interface SaleDate {
    id?: number,
    createTime?: null,
    updateTime?: null,
    spuId?: number,
    baseSaleAttrId: number, //必须
    saleAttrName: string,   //必须
    spuSaleAttrValueList: SpuSaleAttrValueList,
    flag?: boolean,
    saleAttrValue?: string
}
//spu销售属性返回的数据类型
export interface spuSaleAttrList extends ResponseData {
    data: SaleDate[]
}

export interface baseSaleDate {
    id: number,
    name: string
}
export interface baseSaleDateList extends ResponseData {
    data: baseSaleDate[]
}


export interface Attr {
    attrId: number | string, //平台属性ID
    valueId: number | string, //属性值ID
}
export interface SaleAttr {
    saleAttrId: number | string,   //属性id
    saleAttrValueId: number | string,  //属性值ID
}
//添加SKU商品

export interface SkuData {
    category3Id: number | string, //三级分类的ID
    price: number|string,    //SKU价格
    skuAttrValueList?: Attr[],  //平台属性收级
    skuDefaultImg: string,  //售卖商品图片地址
    skuDesc: string,   //sku描述
    skuName: string,   //新增SKU名称
    skuSaleAttrValueList?:SaleAttr[],  //销售属性
    spuId: number | string,  //已有SPUID
    tmId: number | string,   //品牌ID
    weight: number|string  //SKU重量
}

//获取SKU列表
export interface SkuInfoDate extends ResponseData{
    data:SkuData[]
}

//删除已有SPU
